{include inc/top.html}
<script src="{__DATA_URL__}js/jquery.rvf.1.2.js"></script>
<script src="{__CURTPL_URL__}js/form.js"></script>
<script>
    function preview(file){
        $('#preview').attr('src' , '{__UPLOAD_URL__}' + file.url);
        $('#cover').val(file.url);
    }
</script>
<div class="index-main">
    <h1 class="h-title">{$atitle}
        <span class="sub-nav">
            <a href="{url:'admin@art-list' , $ctype}">返回列表</a>
        </span>
     </h1>
    <br/>
    <form action="{url:'admin@art-save'}" id="form" method="post" class="form">
    <input type="hidden" name="art[id]"    value="{$art['id'] ? intval($art['id']) : 0}"/>
    <table class="table">
        <tr>
            <td class="td left" width="40%">
                <div class="opt-label">名称</div>
                <input type="text" name="art[name]" class="req input" nullmsg="请输入分类名称" errmsg="请输入您所应聘的职位" rule="require" msgid="name_msg" value="{$art['name']}"/>
                <span class="error-warpper"><span id="name_msg" class="error-tips"></span></span>
            </td>
            <td class="td left" rowspan="3" >
                <div>封面</div>
                <div>
                {if $art['cover']}
                    <img src="{__UPLOAD_URL__}{$art['cover']|thumb}" id="preview" class="border-gray" width="110"/>
                {else}
                    <img src="{__DATA_URL__}images/null.gif"   id="preview" class="border-gray" width="110"/>
                {/if}
                </div>
                <iframe src="{url:'admin@system-upload-water-1-tw-110-th-80-cb-preview'}" style="height:30px;width:120px;border:none;overflow:hidden;" frameborder="no" border="0" marginwidth="0" marginheight="0" scrolling="no" allowtransparency="yes"></iframe>
            </td>
        </tr>
        <tr style="display:none">
            <td class="td left" >
                <div class="opt-label">映射</div>
                <input type="text" name="art[sname]" class="req input" nullmsg="请输入映射" errmsg="最多只能输入20个字符" rule="require" msgid="sname_msg" notmust="1" maxlimit="30" value="{:REQUEST_TIME}"/>
                <span id="sname_msg" class="error-tips"></span>
            </td>
        </tr>
        <tr style="display:none">
            <td class="td left" >
                <div class="opt-label">来源</div>
                <input type="text" name="art[source]" class="req input" nullmsg="" errmsg="" rule="require" msgid="sname_msg" notmust="1" maxlimit="30" value="本站"/>
                <span id="sname_msg" class="error-tips"></span>
            </td>
        </tr>
        <tr style="display:none">
            <td class="td left" >
                <div class="opt-label">作者</div>
                <input type="text" name="art[author]" class="req input" nullmsg="" errmsg="" rule="require" msgid="sname_msg" notmust="1" maxlimit="30" value="佚名"/>
                <span id="sname_msg" class="error-tips"></span>
            </td>
        </tr>
        <tr style="display:none">
            <td class="td left" >
                <div class="opt-label">标签</div>
                <input type="text" name="art[tag]" class="req input" nullmsg="" errmsg="" rule="require" msgid="sname_msg" notmust="1" maxlimit="30" value="资讯"/>
                <span id="sname_msg" class="error-tips"></span>
            </td>
        </tr>
        <tr style="display:none">
            <td class="td left" >
                <div class="opt-label">排序</div>
                <input type="text" name="art[sort]" class="req input" nullmsg="" errmsg="" rule="require" msgid="sname_msg" notmust="1" maxlimit="30" value="0"/>
                <span id="sname_msg" class="error-tips"></span>
            </td>
        </tr>
        <tr>
            <td class="td left" >
                <div class="opt-label">类别</div>
                <select name="art[parent]" class="select">
                    <option value="0">作为一级分类</option>
                    {foreach $art $k $v}
                        <option value="{$v['id']}" {$v['id'] == $art['parent'] ? 'selected' : ''}>
                            {if substr_count($v['path'] , '#') > 2 }
                                {:str_repeat('&nbsp;&nbsp;&nbsp;' , substr_count($v['path'] , '#') - 3)}
                                &nbsp;└&nbsp;
                            {/if}
                            {$v['name']}</option>
                    {/foreach}
                </select>
                <span class="error-warpper"><span id="name_msg" class="error-tips"></span></span>
            </td>
        </tr>
        <tr>
            <td class="td left" >
                <div class="opt-label">关键字</div>
                <input type="text" name="art[key]" class="req input" errmsg="最多只能输入50个字" rule="require" msgid="key_msg" notmust="1" maxlimit="50" wlen="1" value="{$art['key']}"/>
                <span id="key_msg" class="error-tips"></span>
            </td>
        </tr>
        <tr>
            <td class="td left" >
                <div class="opt-label">描述</div>
                <input type="text" name="art[desc]" class="req input" errmsg="最多只能输入50个字" rule="require" msgid="desc_msg" notmust="1" maxlimit="50"  wlen="1" value="{$art['desc']}"/>
                <span id="desc_msg" class="error-tips"></span>
            </td>
        </tr>
        <tr>
            <td class="td left" >
                <div class="opt-label">详细</div>
                <div></div>
            </td>
        </tr>
        <tr>
            <td class="td left"><input type="button" id="sbtn" url="{url:'art-save'}"  class="button" value="确定"/></td>
        </tr>

    </table>
    <div class="clear"></div>
</div>
{include inc/bottom.html}